package com.way.page;

import com.way.constants.CommonConstants;
import com.way.util.ServletUtil;

/**
 * 表格数据处理
 *
 */
public class TableSupport {

    /**
     * 封装分页对象
     */
    public static Page getPageDomain() {
        Page page = new Page();
        page.setPageNum(ServletUtil.getParameterToInt(CommonConstants.PAGE_NUM));
        page.setPageSize(ServletUtil.getParameterToInt(CommonConstants.PAGE_SIZE));
        page.setOrderByColumn(ServletUtil.getParameter(CommonConstants.ORDER_BY_COLUMN));
        page.setIsAsc(ServletUtil.getParameter(CommonConstants.IS_ASC));
        return page;
    }

    public static Page buildPageRequest() {
        return getPageDomain();
    }
}
